#include <stdio.h>
#include <stdbool.h>
bool is_leap_year(int year) {
    if (year % 100 == 0)
        if (year % 400 == 0)
            return true;
    else if (year % 4 == 0)
        return true;
    return false;
}
int day_of_year(int month, int day, int year) {
    for (int i = 1; i < month; i++) {
        switch (i)
        {
        case 2:
            if (is_leap_year(year))
                day += 29;
            else
                day += 28;
            break;
        case 1: case 3: case 5: case 7: case 8: case 10: case 12:
            day += 31;
            break;
        case 4: case 6: case 9: case 11:
            day += 30;
            break;
        }
    }
    return day;
}
int main(void)
{
    int month, day, year;
    printf("Enter month day year: ");
    scanf("%d%d%d", &month, &day, &year);
    printf("It is the %d day in %d.\n", day_of_year(month, day, year), year);    
    return 0;
}